<div id="edit-table-wrap">
<form action="/update_sampledata" method="post" accept-charset="utf-8">
<table id="edit-table" cellSpacing="0"><tbody>
	<tr>
		<th><span class="label">key</span></th>
		<td><input id="sample-key" name="key" type="text" value="{{ data.key }}" readonly/></td>
	</tr>
	<tr>
		<th><span class="label">category</span></th>
		<td><select id="categories" name="category">
		{% for category in categories %}
			{% ifequal category.key data.category.key %}
			<option value="{{ category.key }}" selected="selected">{{ category.ja }} - {{ category.en }}</option>
			{% else %}
			<option value="{{ category.key }}">{{ category.ja }} - {{ category.en }}</option>
			{% endifequal %}
		{% endfor %}
		</select></td>
	</tr>
	<tr>
		<th><span class="label">pattern</span></th>
		<td class="text-wrap"><input id="sample-pattern" name="pattern" type="text" value="{{ data.pattern }}"/></td>
	</tr>
	<tr>
		<th><span class="label">title</span></th>
		<td class="text-wrap"><input id="sample-title" name="title" type="text" value="{{ data.title }}"/></td>
	</tr>
	<tr>
		<th><span class="label">description</span></th>
		<td class="textarea-wrap"><textarea id="sample-desc" name="description" value="">{{ data.description }}</textarea></td>
	</tr>
	
	<tr>
		<th><span class="label">posted by</span></th>
		<td><p id="user">{{ data.user }}</p></td>
	</tr>
	<tr>
		<th><span class="label">published</span></th>
		<td><p id="published">{{ data.jst_published|date:"Y-m-d H:i:s O" }}</p></td>
	</tr>
	
	{% if data.last_update %}
	<tr>
		<th><span class="label">last update</span></th>
		<td><p id="last-update">{{ data.jst_last_update|date:"Y-m-d H:i:s O" }}</p></td>
	</tr>
	{% endif %}
	
	<tr>
		<th><input id="button-update-view" type="button" value="Update View" /></th>
		<td id="submit-wrap">
			<input id="button-save" type="submit" onclick="return confirm('Are you sure you want to permanently save this entity?');"  value="Save" />
			<input id="button-delete" type="submit" onclick="return confirm('Are you sure you want to permanently delete this entity?');" value="Delete" name="action" />
		</td>
	</tr>
</tbody></table>
</form>
</div>

<div id="ref-data-wrap"><div id="ref-data">
<div class="items"><div class="item">
	<div class="pattern-wrap"><h4 class="pattern"></h4></div>
	<p class="title"><b></b></p>
	<div class="desc"></div>
	<div class="footer">
		<p class="user"><span>posted by:</span><span>{{ data.user }}</span></p>
		<p class="published"><span>published:</span><span>{{ data.jst_published|date:"Y-m-d H:i:s O" }}</span></p>
		{% if data.last_update %}
		<p class="last-update"><span>last update:</span><span>{{ data.jst_last_update|date:"Y-m-d H:i:s O" }}</span></p>
		{% endif %}
	</div>
</div></div>
</div></div>